//
//  LJJRegistViewController.m
//  shopTest
//
//  Created by 梁佳佳 on 2016/11/14.
//  Copyright © 2016年 梁佳佳. All rights reserved.
//

#import "LJJRegistViewController.h"
#import "LJJRegistView.h"
#import "LJJThirdLoginView.h"
#import "LJJRegistNextViewController.h"

@interface LJJRegistViewController ()

@property (strong, nonatomic) LJJRegistView *registView;    /** 注册界面 **/
@property (strong, nonatomic) LJJThirdLoginView *thirdLoginView;    /** 第三方登录 **/

@end

@implementation LJJRegistViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = MAINCOLOR;
    self.edgesForExtendedLayout = 0;
    self.title = @"注册";
    [self configUI];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}
#pragma mark -
#pragma mark - method
- (void)configUI
{
    [self.view addSubview:self.registView];
    [self.view addSubview:self.thirdLoginView];
    __weak typeof (self) weakSelf = self;
    [self.registView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@230);
        make.left.right.top.equalTo(weakSelf.view);
    }];
    [self.thirdLoginView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.registView.mas_bottom);
        make.left.right.equalTo(weakSelf.view);
        make.height.equalTo(@85);
    }];
}
#pragma mark -
#pragma mark - lazy method
- (LJJRegistView *)registView
{
    if (!_registView) {
        _registView = [[LJJRegistView alloc] init];
        __weak typeof(self) weakSelf = self;
        _registView.nextBlock = ^(NSDictionary *dic){
            LJJRegistNextViewController *nextVC = [[LJJRegistNextViewController alloc] init];
            nextVC.userMessageDic = dic;
            [weakSelf.navigationController pushViewController:nextVC animated:YES];
        };
    }
    return _registView;
}
- (LJJThirdLoginView *)thirdLoginView
{
    if (!_thirdLoginView) {
        _thirdLoginView = [[LJJThirdLoginView alloc] init];
    }
    return _thirdLoginView;
}

@end
